$(function () {
    $(".about_h").html("<span>您现在的位置是：</span><span>首页</span>");
    var lines="";
    lines="<a href='index.html'>首页</a>";
    var url="/blog/taxonomy.press";
    var data={};
    $.ajaxSetup({
        async : false//设置同步
    });
    $.post(url,data,function (result,status) {
        if(status=='success'){
            var len=result.taxonomyNames.length;
            for(var i=0;i<len;i++){
                lines+="<a onclick='aclick(this)'>"+result.taxonomyNames[i]+"</a>";
            }
        }

    },"json");
    $("#topnav").html(lines);


})
function aclick(self) {
    var line="";
    var mess=$(self).text();
    $(".about_h").html("<span>您现在的位置是：</span><span>首页</span>><span>"+mess+"</span>");
    var len=0;
    var url="/blog/getInformation.press";
    var data={};
    data.taxonomyname=mess;
    $.ajaxSetup({
        async : false//设置同步
    });
    $.post(url,data,function (result,status) {
      if(status=='success') {
          len = result.contentList.length;
          for (var i = 0; i < len; i++) {
              line += "<div class='newblog'>" +
                  "<ul>" +
                  "<h3><a href='/'>" + result.contentList[i].content_title + "</a></h3>" +
                  "<div class='autor'><span>作者:" + result.contentList[i].content_author + "</span>" +
                  "<span>分类:" + mess + "</span></div>" +
                  "<p>简介：" + result.contentList[i].content_summary + "</p>" +
                  "<a href=" / " class='readmore'>详情</a></p>" +
                  "</ul>" +
                  "<figure><img src='images/01.jpg' ></figure>" +
                  "<div class='dateview'>" + result.contentList[i].content_modified + "</div>" +
                  "</div>";
          }
          $(".bloglist").html(line);
          var pages = result.contentpages;
          var mypages = "";
          if (pages > 0) {
              mypages += "<b><</b><b>1</b>";
          }
          if (pages > 1) {
              for (var i = 2; i <= pages; i++) {   //页数
                  mypages += "<a>" + i + "</a>";
              }
          }
          mypages+="<b>></b>";
     
          $(".page").html(mypages);
      }
        
    },"json");

}